{{/*  Converts data/sql_funcs.yml into table. */}}
{{ range $.Site.Data.sql_funcs }}

{{ if not (isset $.Params 0) }}

<h3>
  <a class="headline-hash" href="#{{ lower .type }}-func">
    {{.type}}
  </a>
  <a name="{{ lower .type }}-func"></a>
</h3>

<p>{{ if .description }} {{ .description | markdownify }} {{ end }}</p>

{{end}}

{{ if or (eq ($.Get 0) .type) (not (isset $.Params 0)) }}

<table>
  <tr>
    <th>
      Function
    </th>
    <th>
      Computes
    </th>
  </tr>
  {{ range .functions }}
  <tr>
    <td>
      {{/*  We use clojure highlighting simply because it looks best with the
      components we want to highlight. In the future, this should be customized
      in some way.  */}}
      {{ highlight .signature "clojure" "" }}
    </td>
    <td>

      {{ .description | markdownify }}

      {{ if .url}}(<a href="{{ .url}}">docs</a>){{ end }}

    </td>
  </tr>
  {{ end }} {{/*  {{ range .functions }} */}}
</table>

{{end}}

{{ end }}{{/*  {{ range $.Site.Data.sql_funcs }} */}}
